import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx/common/models/messege.dart';
import 'package:getx/common/utils/request.dart';

class HomeController extends GetxController {
  HomeController();

  _initData() {
    update(["home"]);
  }

  void onTap() {}

  // @override
  // void onInit() {
  //   super.onInit();
  // }

  @override
  void onReady() {
    super.onReady();
    _initData();
  }

  void get_info() async {
    var data = await Api().get('api-message-brief', null);
    Messege messege = Messege.fromJson(data as Map<String, dynamic>);
    print(messege.chat);
  }

  void get_messege() async {
    var data = await Api().get('api-message-brief', null);
    print(data);
    // Get.dialog(Text('请求成功'));
  }

  // @override
  // void onClose() {
  //   super.onClose();
  // }
}
